<%@page contentType = "text/html;charset=UTF-8" %>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.HashSet"%>
<%@page import="com.crishne.anwo.model.Menu"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	//用于JS
	String firstSrc = null;
	List<Menu> menuList = (List<Menu>)session.getAttribute("userMenu");
	
	List<Menu> firstMenuList = new ArrayList();
	if(null != menuList && menuList.size()>0){
		for(int i=0;i< menuList.size();i++){
			if(menuList.get(i).getStPid() == null || "".equals(menuList.get(i).getStPid()) ){
				firstMenuList.add(menuList.get(i));
			}
		}
	}
	
	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>安我官网管理系统</title>
	<meta name="description" content="particles.js is a lightweight JavaScript library for creating particles.">
	<meta name="author" content="Vincent Garreau" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<link rel="stylesheet" media="screen" href="static/css/style.css">
	<script src="static/js/lib/require.js" data-main="static/js/bm/main" ></script>
</head>
<body id="currPage" data-pageJs="index">
  <!---添加弹出框--->
<div class="tan add">
	<div class="tan_min">
    	<p class="title">修改密码</p>
        <table class="table">
          <tr><td width="100">原密码:</td><td width="370"><input class="text" type="password" id="stPwd"/></td></tr>
         <tr><td>新密码:</td><td><input class="text" type="password" id="stNewPwd"/></td></tr>
         <tr><td>确认密码:</td><td><input class="text" type="password" id="stNewPwdConfirm"/></td></tr>
         <tr><td></td><td><input class="submit" type="button" value="提交"  /><input class="cancel" type="button" value="取消"  /></td></tr>
        </table>
    </div>
</div>
<!---添加弹出框结束--->
<!---头部-->
<div class="top">
  <p class="logn"><img src="static/images/logo2.png" /></p>
  <span class="titles">安我官网管理系统</span><a class="menu"><img src="static/images/icon_header.png" /><i></i></a>
  <ul class="menu_min">
    <li><img src="static/images/icon_user.png"  />User：<%=session.getAttribute("username") %></li>
    <li><a id="setPwd"><img src="static/images/icon_password.png"  />修改密码</a></li>
    <li><a href="logout.htm"><img src="static/images/icon_closet.png"  />退出账户</a></li>
  </ul>
</div>
<!---头部结束-->
<!---左侧菜单-->
<div class="left">
  <ul class="lefts nice">
  <% 

 for(int i=0;i<firstMenuList.size();i++){
	 
	 //收集二级菜单
	 List<Menu> secondMenuList = new ArrayList();
	for(int j=0;j< menuList.size();j++){
		if(menuList.get(j).getStPid() != null && 
				menuList.get(j).getStPid().equals(firstMenuList.get(i).getStMenuId())){
			secondMenuList.add(menuList.get(j));
		}
	}
	
	 //添加一级菜单
%>	
    <li><a class="one <%=i==0?"one_fouer":"" %>"><img src="static/images/menu/<%=firstMenuList.get(i).getStImage() %>"  /><%=firstMenuList.get(i).getStMenuName() %><i></i></a>
<%
	if(secondMenuList.size()>0){
  %>
      <ul>
<%
	//添加二级菜单
    for(int k=0;k<secondMenuList.size();k++){
    	//收集三级菜单
   	 	List<Menu> thirdMenuList = new ArrayList();
 		for(int j=0;j< menuList.size();j++){
 			if(menuList.get(j).getStPid() != null && 
 				menuList.get(j).getStPid().equals(secondMenuList.get(k).getStMenuId())){
 				thirdMenuList.add(menuList.get(j));
 			}
 		}
 		
 		if ( null != secondMenuList.get(k).getStMenuUrl() && !"".equals(secondMenuList.get(k).getStMenuUrl()) && null == firstSrc ) {
 			firstSrc = secondMenuList.get(k).getStMenuUrl();
		}
 		
%>
        <li><a class="<%=(i==0 && k==0)?"fouer":"" %>" src="<%=null != secondMenuList.get(k).getStMenuUrl() && !"".equals(secondMenuList.get(k).getStMenuUrl()) ? secondMenuList.get(k).getStMenuUrl() : ""%>"><%=secondMenuList.get(k).getStMenuName() %><b></b></a></li>
<%
    }
	
%>
		</ul>
				

<%
    
 }
%>
		</li>
				

<%
    
 }
%>

</div>
<!---左侧菜单结束-->
<!---右侧主要内容-->
<iframe id="min" class="right" border=0 name=lantk src='<%=firstSrc %>' width=100%; height=100%; allowTransparency scrollbars=yes frameBorder='0'></iframe>
</body>
</html>